#pragma once
#include<QThread>
#include<opencv2\highgui\highgui.hpp>
#include<opencv2\core\core.hpp>
#include"camcapture.h"
class cameraThread :
	public QThread
{
	Q_OBJECT
public:
	cameraThread(void);
	~cameraThread(void);
	void stop();
	
	void startCam(camCapture* show,QTimer *timer,int camera=count,const cv::string& filename="Camera",  double fps=20.0, cv::Size frameSize=cv::Size(400,300),bool isColor=true, int fourcc=CV_FOURCC('P','I','M','1') );
private:
	void run();
	bool isStop;
	cv::VideoCapture capture;
	cv::VideoWriter  writer;
	cv::Mat frame;
	cv::Size size;
	bool isFrameReady;
	static int count;
signals:
	void sendFrame( cv::Mat *);
public slots:
	void nextFrame();
	
};



